import { cur_event_check } from '../../../../global_comps/Classes/cla_event_check';
import { forBindEventThis } from '../../../../global_comps/Func/forBindEventThis';
import { upload_func_certain_dataMana } from './cla_upload_func_certain_dataMana';
import type { upload_func_certain_props } from './cla_upload_func_certain_props';

const upload_func_certain_operateTag = 'upload_func_certain_operate';

export class upload_func_certain_operate extends upload_func_certain_dataMana {
  get [Symbol.toStringTag]() {
    return upload_func_certain_operateTag;
  }

  constructor(props: upload_func_certain_props) {
    super(props);

    forBindEventThis(this);

    this.eventM.addEventListen(
      this.dom_body,
      'click',
      this.eventBind.body_click
    );
  }

  /**
   * 元素 点击 上传 信息
   */
  body_click(event: MouseEvent) {
    if (!cur_event_check.set_cur_event(event).left_click().result) {
      return;
    }
    if (this.father_operate == undefined) {
      this.get_father_operate();
    }

    this.father_operate.upload_file();
  }
}
